#include "myProcessBar.h"
#include <stdio.h>
#include <string.h>
#include <unistd.h>

const char* label="|/-\\";
void processBar(int speed){
  int cnt=0,len=strlen(label);
  char bar[NUM];
  memset(bar,0,sizeof(bar));
  while(cnt<=100){
    printf("[%-100s][%d%%] %c\r",bar,cnt,label[cnt%len]);
    fflush(stdout);
    bar[cnt++]=BODY;
    if(cnt<100)bar[cnt]=RIGHT;
    usleep(speed);
  }
  printf("\n");
}
